package org.dtrd.modules.drug.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.drug.entity.bean.DrugDetail;

import java.util.Date;


/**
 * <p>
 * 药品库
 * </p>
 *
 * @author QR
 * @since 2021-12-02
 */
@Getter
@Setter
@TableName("dtrd_ext_ems_yw_drugs")
public class DtrdExtEmsYwDrugs {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 所属分类
     */
    @TableField("drug_categoryId")
    private Integer drugCategoryid;

    /**
     * 药品名称
     */
    @TableField("drug_name")
    private String drugName;

    /**
     * 主要成分（及其化学名称）
     */
    @TableField("drug_component")
    private String drugComponent;

    /**
     * 性状
     */
    @TableField("drug_property")
    private String drugProperty;

    /**
     * 规格型号
     */
    @TableField("drug_spec")
    private String drugSpec;

    /**
     * 用法用量
     */
    @TableField("drug_usage")
    private String drugUsage;

    /**
     * 不良反应
     */
    @TableField("drug_untoward")
    private String drugUntoward;

    /**
     * 禁忌
     */
    @TableField("drug_taboo")
    private String drugTaboo;

    /**
     * 适应症
     */
    @TableField("drug_indication")
    private String drugIndication;

    /**
     * 药物相互作用
     */
    @TableField("drug_interact")
    private String drugInteract;

    /**
     * 药物过量
     */
    @TableField("drug_overdose")
    private String drugOverdose;

    /**
     * 药理毒理
     */
    @TableField("drug_pharmacology")
    private String drugPharmacology;

    /**
     * 注意事项
     */
    @TableField("drug_be_careful")
    private String drugBeCareful;

    /**
     * 创建时间
     */
    @TableField("drug_create_time")
    private Date drugCreateTime;

    /**
     * 药材库标签
     */
    @TableField("drug_tips")
    private String drugTips;

    /**
     * 创建人
     */
    @TableField("drug_creater")
    private Integer drugCreater;

    /**
     * 最后编辑人
     */
    @TableField("drug_editor")
    private Integer drugEditor;

    /**
     * 最后编辑时间
     */
    @TableField("drug_edit_time")
    private Date drugEditTime;

    /**
     * 删除人
     */
    @TableField("drug_deleter")
    private Integer drugDeleter;

    /**
     * 删除时间
     */
    @TableField("drug_del_time")
    private Date drugDelTime;

    /**
     * 药品URL
     */
    @TableField("drug_url")
    private String drugUrl;

    @TableField("drug_thumb")
    private String drugThumb;

    /**
     *  贮藏
     */
    @TableField("drug_storage")
    private String drugStorage;

    /**
     * 包装
     */
    @TableField("drug_packing")
    private String drugPacking;

    /**
     * 有效期
     */
    @TableField("drug_expirydate")
    private String drugExpirydate;

    /**
     * 批准文号
     */
    @TableField("drug_approval")
    private String drugApproval;

    /**
     * 生产企业
     */
    @TableField("drug_company")
    private String drugCompany;

    /**
     * 通用名称
     */
    @TableField("drug_name_general")
    private String drugNameGeneral;

    /**
     * 用药方案 1-口服药,2-胰岛素针,3-GLP-1类似物,4-其他
     */
    @TableField("drug_use")
    private Integer drugUse;

    public DtrdExtEmsYwDrugs init() {
        isDel = 0;
        drugCreateTime = new Date();
        return this;
    }

    public DtrdExtEmsYwDrugs parseFromDto(DrugDetail dto) {
        dataId = dto.getDataId();
        drugCategoryid = dto.getDrugCategoryid();
        drugName = dto.getDrugName();
        drugComponent = dto.getDrugComponent();
        drugProperty = dto.getDrugProperty();
        drugSpec = dto.getDrugSpec();
        drugUsage = dto.getDrugUsage();
        drugUntoward = dto.getDrugUntoward();
        drugTaboo = dto.getDrugTaboo();
        drugIndication = dto.getDrugIndication();
        drugInteract = dto.getDrugInteract();
        drugOverdose = dto.getDrugOverdose();
        drugPharmacology = dto.getDrugPharmacology();
        drugBeCareful = dto.getDrugBeCareful();
        drugCreateTime = dto.getDrugCreateTime();
        drugTips = dto.getDrugTips();
        drugCreater = dto.getDrugCreater();
        drugEditor = dto.getDrugEditor();
        drugEditTime = dto.getDrugEditTime();
        drugDeleter = dto.getDrugDeleter();
        drugDelTime = dto.getDrugDelTime();
        drugUrl = dto.getDrugUrl();
        drugThumb = dto.getDrugThumb();
        drugStorage = dto.getDrugStorage();
        drugPacking = dto.getDrugPacking();
        drugExpirydate = dto.getDrugExpirydate();
        drugApproval = dto.getDrugApproval();
        drugCompany = dto.getDrugCompany();
        drugNameGeneral = dto.getDrugNameGeneral();
        drugUse = dto.getDrugUse();
        return this;
    }


}
